package kr.hkit.powerjava.chapter06.assign_if;

public class One {

	final int price = 100;
	private int num;
	private int total;

	public void setNum(int num) {
		this.num = num;
	}

	int price() {
		if (num >= 100) {
			total = (int) (price * 0.8) * num;
		}

		else {
			if (num >= 20) {
				total = (int) (price * 0.85) * num;
			}

			else {
				if (num >= 10) {
					total = (int) (price * 0.9) * num;
				} else {
					total = price * num;
				}
			}
		}

		return total;
	}

	@Override
	public String toString() {
		return "One [가격은 " + price() + "]";
	}

}
